export interface IHttpParams {
  method?:
  | "get"
  | "GET"
  | "delete"
  | "DELETE"
  | "options"
  | "OPTIONS"
  | "post"
  | "POST" /** 异步请求的方式，如：post、get等 */;
  url: string /** 异步请求的地址 */;
  data?: any /** 发送的数据 */;
  params?: any
  keyName?: string
  withCredentials?: boolean;
  responseType?: string
}

export interface IHttpResponse<T> {
  code: number /** 后端返回的状态码 */;
  data: T /** 后端返回的数据 */;
  message?: string /** 后端请求返回的提示信息 */;
  unlogin?: boolean /** 发送当前请求的时候是否已经登录 */;
}
export interface ItagItem {
  path: string
  name: string
  meta: IMata
  [propName: string]: any;
}
export interface IMata {
  title: string
}

// export interface IMenu {
//   icon: string
//   children: IMenu[],
// menuId: number,
// name: string
// open?: string,
// orderNum: number,
// parentId: number,
// parentName?: string
// perms: string
// type: number,
// url: string
// }
export interface IMenu {
  id: number;
  pid: number;
  name: string;
  icon: string;
  component: string;
  menuType: string;
  sort: number;
  childList: IMenu[];
  url: string

}
export interface IPageResult {
  currentPage: number
  pageSize: number,
  total: number,

}
export interface IFilter {
  id: number;
  name: string /** 歌手名 */;
  alias?: string[] /** 歌手别名 */;
  img1v1Url: string /** 歌手头像 */;
}

export interface ICommon {
  list: any[];
  originList: Object;
  listLoading: boolean;
  params: any;
  ids: number[];
  showList: boolean;
  total: number;
  currentPage: number;
  pageSize: number;
  overFlow: boolean;
  isaddUp: boolean;
  ori: any
}
export interface IPage<T> {
  page: IPageDetail<T>
}
export interface IPageDetail<T> {
  list: T[];
  total: number
}
export class storeproduct {
  id?: number;
  name = '';
  merId = ''
  image = ''
  sliderImage = ''
  storeName = ''
  storeInfo = ''
  keyword = ''
  barCode = ''
  cateId = ''
  price = ''
  vipPrice = ''
  otPrice = ''
  postage = ''
  unitName = ''
  sort = ''
  sales = ''
  stock = ''
  isShow = ''
  isHot = ''
  isBenefit = ''
  isBest = ''
  isNew = ''
  addTime = ''
  isPostage = ''
  isDel = ''
  merUse = ''
  giveIntegral = ''
  cost = ''
  isSeckill = ''
  isBargain = ''
  isGood = ''
  isSub = ''
  ficti = ''
  browse = ''
  codePath = ''
  soureLink = ''
  videoLink = ''
  tempId = ''
  specType = ''
  activity = ''
  flatPattern = ''
  isRecycle = ''
  constructor(data?: storeproduct) {
    data && this.setProps(data);
  }

  setProps(data: storeproduct) {
    (Object.keys(this) as Array<keyof Istoreproduct>).forEach((key) => {
      // @ts-ignore
      this[key] = data[key]
    })
  }
}

export type Istoreproduct = Omit<storeproduct, 'setProps'>